package bupt.xixi;

import bupt.xixi.netty.NettyServer;
import lombok.SneakyThrows;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = {"bupt.xixi"})
public class NettyTestServer {

    @SneakyThrows
    public static void main(String[] args) {
        // spring注入
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(NettyTestServer.class);
        NettyServer nettyServer = (NettyServer) context.getBean("nettyServer");

        // 开启服务
        nettyServer.start();

    }
}
